@using System.Text.RegularExpressions
@using ZKEACMS.SectionWidget.Models
@model SectionContent
@{
    Layout = Layouts.ClientPopUp;
    SectionContentVideo video = Model as SectionContentVideo;
    if (video == null)
    {
        return;
    }
    ViewBag.Title = video.VideoTitle;
    Style.Reqiured("Section").AtFoot();
}

<div class="pop-video">
    @if (video.Url.IsNotNullAndWhiteSpace())
    {
        <video id="video-player" controls autoplay muted preload="metadata"
           name="media"
           src="@Url.Content(video.Url)"
           style="width:@(video.Width.HasValue?video.Width+"px":"auto");height:@(video.Height.HasValue?video.Height+"px":"auto")">
            Your brower does not support playing video.
        </video>
    }
    else if (video.Code.IsNotNullAndWhiteSpace())
    {
        @Html.Raw(video.Code)
    }
</div>